package com.longrise.android.byjk.plugins.vip.myintegral;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by callxkj on 2017/4/17.
 * 我的积分
 */

public class MyIntegralPagerAdapter extends FragmentPagerAdapter{

    MyIntegralPagerAdapter(FragmentManager fragmentManager){
        super(fragmentManager);
    }

    @Override
    public Fragment getItem(int position) {
        MyIntegralFragment fragment = new MyIntegralFragment();
        Bundle bundle = new Bundle();
        String value = null ;
        switch (position){
            case 0:
                value = MyIntegralFragment.PAGE_ALL;
                break;
            case 1:
                value = MyIntegralFragment.PAGE_EXPEND;
                break;
            case 2:
                value = MyIntegralFragment.PAGE_INCOME;
                break;
        }
        bundle.putString(MyIntegralFragment.PAGE,value);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        String title = null;
                switch (position){
                    case 0:
                        title = "全部";
                        break;
                    case 1:
                        title = "支出";
                        break;
                    case 2:
                        title = "收入";
                        break;
                }
        return title;
    }

}
